<%@ page contentType="text/html;charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>登录</title>
    <%@include file="/common/baselink.jsp"%>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script type="text/javascript">
    	if(window.top!==window.self){window.top.location=window.location};
	</script>
</head>
<body>
<form id="form" action="" onsubmit="return false;">
<ul>
	<li><input type="text" id="user_no" name="user_no" /></li>
	<li><input type="password" id="user_pwd" name="user_pwd"/></li>
	<li><input type="submit" value="登录"/></li>
</ul>
</form>
<script type="text/javascript">
Ext.onReady(function(){
	Ext.get("form").on("submit",function(){
		var pwd_md5_key = Utils.md5(Ext.get("user_pwd").getValue());
		var pwd = Utils.encrypt(pwd_md5_key);
		AjaxUtils.CallService({
			url: CONTEXT.contextPath+"/v1/login",
			params: {
				"user_no": Ext.get("user_no").getValue(),
				"user_pwd": pwd
			},
			call: function(result){
				if(result.status == "OK"){
					window.location.href = CONTEXT.contextPath+"/index";
				}
			}
		});
	})
});
</script>
</body>
</html>